package com.atjava.nebula.frames.auth.dao;

import java.util.List;

import com.atjava.nebula.core.dao.ibatis.GenericIBatisDao;
import com.atjava.nebula.frames.auth.SysAuth;
import com.atjava.nebula.frames.resources.SysResource;
import com.atjava.nebula.frames.role.SysRole;

public class AuthDao extends GenericIBatisDao<SysAuth, Integer>{

	public List<SysResource> getResourcesByRole(Short roleId){
		return getSqlMapClientTemplate().queryForList("SysAuth.GetResourcesByRole", roleId);
	}
	
	public List<SysResource> getResourcesByRoles(List<Short> roleIds){
		return getSqlMapClientTemplate().queryForList("SysAuth.GetResourcesByRoles", roleIds);
	}
	
	public List<SysRole> getRolesByUser(String userId){
		return getSqlMapClientTemplate().queryForList("SysAuth.GetRolesByUser", userId);
	}
	
	
}
